/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package co.gov.igac.observatorio.entidades.propuesta;

import co.gov.igac.observatorio.entidades.idea.Entidad;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author bigbang
 */
@Entity
@Table(name = "sig")
@NamedQueries({
    @NamedQuery(name = "Sig.findAll", query = "SELECT s FROM Sig s"),
    @NamedQuery(name = "Sig.findByIdSig", query = "SELECT s FROM Sig s WHERE s.idSig = :idSig"),
    @NamedQuery(name = "Sig.findByNombre", query = "SELECT s FROM Sig s WHERE s.nombre = :nombre"),
    @NamedQuery(name = "Sig.findByDescripcion", query = "SELECT s FROM Sig s WHERE s.descripcion = :descripcion"),
    @NamedQuery(name = "Sig.findByUrl", query = "SELECT s FROM Sig s WHERE s.url = :url")})
public class Sig implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idSig")
    private Integer idSig;
    @Size(max = 1000)
    @Column(name = "nombre")
    private String nombre;
    @Size(max = 5000)
    @Column(name = "descripcion")
    private String descripcion;
    @Size(max = 1000)
    @Column(name = "url")
    private String url;
    @JoinColumn(name = "Entidad_idEntidad", referencedColumnName = "idEntidad")
    @ManyToOne
    private Entidad entidad;

    public Sig() {
    }

    public Sig(Integer idSig) {
        this.idSig = idSig;
    }

    public Integer getIdSig() {
        return idSig;
    }

    public void setIdSig(Integer idSig) {
        this.idSig = idSig;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public Entidad getEntidad() {
        return entidad;
    }

    public void setEntidad(Entidad entidad) {
        this.entidad = entidad;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idSig != null ? idSig.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Sig)) {
            return false;
        }
        Sig other = (Sig) object;
        if ((this.idSig == null && other.idSig != null) || (this.idSig != null && !this.idSig.equals(other.idSig))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.entidades.Sig[ idSig=" + idSig + " ]";
    }
}
